<html>
<head><meta charset="utf-8"><title>Vec&lt;x, Global&gt; · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Vec.3Cx.2C.20Global.3E.html">Vec&lt;x, Global&gt;</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="227116736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Vec%3Cx%2C%20Global%3E/near/227116736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Vec.3Cx.2C.20Global.3E.html#227116736">(Feb 20 2021 at 20:43)</a>:</h4>
<p>In this code:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">Vec</span>::<span class="n">new</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="n">x</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="mi">3</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>when I hover <code>x</code>it says <code>Vec&lt;i32, Global&gt;</code>.<br>
What does the <code>Global</code> mean / where is it coming from?</p>



<a name="227116794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Vec%3Cx%2C%20Global%3E/near/227116794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Vec.3Cx.2C.20Global.3E.html#227116794">(Feb 20 2021 at 20:44)</a>:</h4>
<p>seems to link to <code>alloc::alloc::Global</code></p>



<a name="227123943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Vec%3Cx%2C%20Global%3E/near/227123943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Vec.3Cx.2C.20Global.3E.html#227123943">(Feb 20 2021 at 22:38)</a>:</h4>
<p>Vec now has a second type parameter for the Allocator: <a href="https://doc.rust-lang.org/std/vec/struct.Vec.html">https://doc.rust-lang.org/std/vec/struct.Vec.html</a></p>



<a name="227124069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Vec%3Cx%2C%20Global%3E/near/227124069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Vec.3Cx.2C.20Global.3E.html#227124069">(Feb 20 2021 at 22:40)</a>:</h4>
<p>see <a href="https://github.com/rust-lang/rust/issues/32838">https://github.com/rust-lang/rust/issues/32838</a></p>



<a name="227128139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Vec%3Cx%2C%20Global%3E/near/227128139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Vec.3Cx.2C.20Global.3E.html#227128139">(Feb 20 2021 at 23:52)</a>:</h4>
<p>Though, isn't r-a supposed to filter out defaulted type parameters?</p>



<a name="227147947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Vec%3Cx%2C%20Global%3E/near/227147947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Vec.3Cx.2C.20Global.3E.html#227147947">(Feb 21 2021 at 06:48)</a>:</h4>
<p>We do filter them out for hints, but not for hovers, showing "full" type information there.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>